#define _CRT_SECURE_NO_WARNINGS 1
#include "list.h"

void TestList1()
{
	ListNode* plist = ListInit();
	ListPushBack(plist, 1);
	ListPushBack(plist, 2);
	ListPushBack(plist, 3);
	ListPushBack(plist, 4);
	ListPrint(plist);
	ListPopFront(plist);
	ListPopFront(plist);
	ListPrint(plist);
	ListPopBack(plist);
	ListPrint(plist);
	ListDestory(plist);
}

void TestList2()
{
	ListNode* plist = ListInit();
	ListPushBack(plist, 1);
	ListPushBack(plist, 2);
	ListPushBack(plist, 3);
	ListPushBack(plist, 4);
	ListPrint(plist);
	ListNode* pos = ListFind(plist, 3);
	if (pos)
	{
		ListInsert(pos, 30);
		ListPrint(plist);
	}
	pos = ListFind(plist, 30);
	if (pos)
	{
		ListErase(pos);
		ListPrint(plist);
	}
	ListDestory(plist);
}

int main()
{
	TestList1();
	return 0;
}